Export into MS Word at specic location in document

Hi,

I am currently exporting a module into MS word in table format. I will be exporting into a specific document template (not normal.doc) but I would like to export to a particular place in the template. The location could be identified by section number or a specific textual or other tag placed into the template. I have looked into word.dxl trying to find a method of setting the injection point but have had no success.

Can anyone suggest a method if importing to a sepecific location in a word template?

Many thanks for any help suggested.

Kind regards

Patrick 


patrickAtWork - Fri Oct 17 06:16:27 EDT 2014

Re: Export into MS Word at specic location in document
Mathias Mamsch - Mon Oct 20 04:38:14 EDT 2014

I would say, that you insert a bookmark "DOCSTART" into the Word template, but then you would have to adapt the word.dxl to issue a find to set the cursor to the bookmark location, before actually starting the export. The VBA code for this would be:

Selection.GoTo What:=wdGoToBookmark, Name:="DOCSTART"

Should not be to complicated. If you need help, just come back here ...

Regards, Mathias

Re: Export into MS Word at specic location in document
patrickAtWork - Tue Oct 21 06:07:04 EDT 2014

Mathias Mamsch - Mon Oct 20 04:38:14 EDT 2014

I would say, that you insert a bookmark "DOCSTART" into the Word template, but then you would have to adapt the word.dxl to issue a find to set the cursor to the bookmark location, before actually starting the export. The VBA code for this would be:

Selection.GoTo What:=wdGoToBookmark, Name:="DOCSTART"

Should not be to complicated. If you need help, just come back here ...

Regards, Mathias

Hi Mathias,

 

Many thanks for your answer, it looks exactly what I need. I have been diverted to another project so it will be a week or so before I get back to this.

Looking at word.dxl I think that I would have to set the cursor inside thefunction:

"moveFromTempDocToDestinationDoc()"

template. Can you advise if you think that this is agood place to start?

A second but related question when doing an export to word the process appears to copy the content extracted to a temporary document then to the destination document? Is this correct?

many thanks

Patrick